<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //  所谓高阶函数，就是函数参数可以是函数
    function fn(n){
        return Math.abs(n);
    }


    function add(num1,num2,fn){
        return fn(num1)+fn(num2);
    }


    let res = add(-10,10,Math.abs);
    console.log(res);
</script>
</html>